package cn.mesmile.grpc.controller;

import cn.mesmile.grpc.client.HelloWorldClient;
import cn.mesmile.grpc.demo.Greeting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * @author zb
 * @date 2021/1/4 10:49
 * @Description
 */
@RequestMapping("/api/v1/grpc")
@RestController
public class GrpcController {

    @Autowired
    private HelloWorldClient helloWorldClient;

    @GetMapping("/hello")
    public String hello() {
        List<String> stringList = Arrays.asList("11", "22", "33");
        Greeting greeting = helloWorldClient.sayHello("xing", "ming", stringList);

        return null;
    }
}
